// Using strtok to tokenize a string.
// Date 10/10/2018
// By Ben

#include <iostream>
#include <string.h>

using namespace std;
using std::cout;
using std::endl;
using std::cin;

int main(int argc, char *argv[]){

	string str = "Hello-Brave-New-World";
	//Split the string
	char *tok = strtok(&str[0], "-");

	//Keep splitting the string
	while (tok != NULL){
		//Output tok element
		std::cout << tok << endl;
		//Get next token
		tok = strtok(NULL, "-");
	}

	system("pause");
	return 0;
}